package com.qf.smsplatform.common.exception;

/**
 * projectName: sms-platform
 *
 * @author: 黄睿武
 * time: 2021/8/11 22:18
 * description:
 */

import com.qf.smsplatform.common.enums.SmsEnum;

/**
 * 出现问题是,需要抛出的异常信息
 */
public class SmsException extends RuntimeException {

    private Integer code;

    /**
     * Constructs a new runtime exception with the specified detail message.
     * The cause is not initialized, and may subsequently be initialized by a
     * call to {@link #initCause}.
     *
     * @param message the detail message. The detail message is saved for
     *                later retrieval by the {@link #getMessage()} method.
     */
    public SmsException(Integer code,String message) {
        super(message);
        this.code = code;
    }

    public SmsException(SmsEnum SmsEnum) {
        super(SmsEnum.getMsg());
        this.code = SmsEnum.getCode();
    }

    public Integer getCode() {
        return code;
    }
}
